import instance from "./counter";

//k线图
export function Kreq() {
  return instance({
    method: 'GET',
    url: '/admin/data/kData',
  })
}


//登录
export function loginReq(username, password) {
  return instance({
    method: 'POST',
    url: '/users/login',
    data: { username, password }
  })
}
//列表
export function listReq(current, pagesize) {
  return instance({
    method: 'GET',
    url: '/goods/list',
    params: { current, pagesize }
  })
}

//获取用户信息
export function infoReq(id) {
  return instance({
    method: 'GET',
    url: '/users/info',
    params: { id }
  })
}

//修改个人资料
export function updateReq(id, age, gender, nickname) {
  return instance({
    method: 'POST',
    url: '/users/update',
    data: { id, age, gender, nickname }
  })
}

//注销登录
export function logout(id) {
  return instance({
    method: 'GET',
    url: '/users/logout',
    params: { id }
  })
}